package com.glsc.ngateway.opmanage.event.vo;

import com.glsc.ngateway.opmanage.enums.TaskTypeUrlEnum;
import io.swagger.annotations.ApiModelProperty;
import org.springframework.context.ApplicationEvent;


public class TaskInfoEvent extends ApplicationEvent {

    @ApiModelProperty(value = "业务id")
    private String businessId;

    @ApiModelProperty(value = "任务名称")
    private String name;

    @ApiModelProperty(value = "枚举")
    private TaskTypeUrlEnum taskTypeUrlEnum;

    @ApiModelProperty(value = "操作类型 0创建待办，1将待办任务设置完已完成")
    private String op;


    public TaskInfoEvent(Object source) {
        super(source);
    }

    public String getOp() {
        return op;
    }

    public void setOp(String op) {
        this.op = op;
    }

    public String getBusinessId() {
        return businessId;
    }

    public void setBusinessId(String businessId) {
        this.businessId = businessId;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public TaskTypeUrlEnum getTaskTypeUrlEnum() {
        return taskTypeUrlEnum;
    }

    public void setTaskTypeUrlEnum(TaskTypeUrlEnum taskTypeUrlEnum) {
        this.taskTypeUrlEnum = taskTypeUrlEnum;
    }


    public static TaskInfoEvent create(String name, String businessId, TaskTypeUrlEnum taskTypeUrlEnum, String op) {
        TaskInfoEvent taskInfoEvent = new TaskInfoEvent(name);
        taskInfoEvent.setName(name);
        taskInfoEvent.setBusinessId(businessId);
        taskInfoEvent.setOp(op);
        taskInfoEvent.setTaskTypeUrlEnum(taskTypeUrlEnum);
        return taskInfoEvent;
    }
}
